<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
/*
 * use think\Route;
 *
 * Route::rule('/', 'main/run');
 * Route::rule('run/:year/[:month]/[:day]$', 'main/run', 'GET', [], ['year' => '\d+']);
 * Route::rule('kyo/', 'index/index/index');
 */
/*
 * Route::miss(function() {
 *     return '<h1>MISS.....!</h1>';
 * });
 */


return [
    '__pattern__' => [
        'name' => '\w+',
        'year' => '\d+'
    ],
    'test' => function() {
        dump(aliyun_sms_send('13602447602', '8856'));
        /*
         * array(2) {
         *   ["Model"] => string(26) "105045526424^1106981052194"
         *         ["RequestId"] => string(36) "C8DD237B-8B1C-4E2C-93B8-CF6255139153"
         * }
         */

    },
    /*
     * 'mail' => function() {
     *     dump(send_mail('mf11e0630087@163.com', "测试", '<span style="color:red;font-size:16px"><a href="http://www.baidu.com">baidu.com</a></span>'));
     * },
     * 'ip/[:ip]' => function($ip = '223.5.5.5') {
     *     dump(get_ip_msg($ip));
     * },
     * 'curl/[:phone]/[:sms]' => function($phone = 13602447602, $sms = '123456') {
     *     dump(aliyun_sms_send($phone, $sms));
     * },
     */
    // 'bd' => 'http://www.baidu.com',
    // '/' => 'index/index',
    // 'run/:year/[:month]/[:day]$' => 'main/run',
    /*
     * '__miss__' => function() {
     *     return '<h1>MISS.....!</h1>';
     * },
     */
    '[hello]'     => [
        ':id'   => ['index/hello', ['method' => 'get'], ['id' => '\d+']],
        ':name' => ['index/hello', ['method' => 'post']],
    ],

];
